package domain

import "time"

type Activity struct {
	Title   string    `gorm:"column:activityTitle" structs:"title" json:"title"`
	PicPath string    `gorm:"column:activityPicPath" structs:"picpath" json:"picpath"`
	Detail  string    `gorm:"column:activityDetail" structs:"detail" json:"detail"`
	Time    time.Time `gorm:"column:activityTime" structs:"time" json:"time"`
	ID      string    `gorm:"column:activityID" structs:"id" json:"id"`
	UnionID  string    `gorm:"column:activityUnionID" structs:"unionid" json:"unionid"`
}

// 将类转化为字符串输出
func (a Activity) ToString() string {
	var resStr string
	resStr = "{ title: " + a.Title + " , picpath: " + a.PicPath + " , detail: " + a.Detail + " , time: " + a.Time.String() + " , ID: " + a.ID + " , openID: " + a.UnionID
	return resStr
}

// 指定表名
func (activity Activity) TableName() string {
	return "activity_data"
}
